import React, { FC } from 'react';
import ConfigContext, { configProviderDefault, ConfigConsumerProps } from './context';

export interface ConfigProviderProps {
  config?: Partial<ConfigConsumerProps>;
}
const ConfigProvider: FC<ConfigProviderProps> = ({ children, config = {} }) => {
  return (
    <ConfigContext.Provider value={{ ...configProviderDefault, ...config }}>
      {children}
    </ConfigContext.Provider>
  );
};

export default ConfigProvider;
